/**
 * 产品描述编辑
 * @author linfeng
 * @since 2019/09/05
 */
layui.define(['form', 'layedit', 'laydate'], function (exports) {
    let $ = layui.$;
    let form = layui.form;
    let layer = layui.layer;
    let index;

    // 提交
    form.on('submit(zmn-form-submit)', function (obj) {
        let data = obj.field;
        let url = "/product/addEditDesc.action";
        let content = ue.getContent();
        $.ajax({
            async: false,
            type: "POST", url: url,
            contentType: "application/json", dataType: "json", data: JSON.stringify(data),
            beforeSend: function () {
                index = layer.load(1, {
                    shade: [0.5, '#DBDBDB']
                });
            },
            success: function (json) {
                parent.layer.msg(json.message);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
            },
            complete:function () {
                layer.close(index);
            }
        })

        return false;
    });

    //对外暴露的接口
    exports('product_desc_edit_js', {});
});


